﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using IdentityMine.Windows.Eventing;


namespace WpfTest
{
    /// <summary>
    /// Interaction logic for UserControl1.xaml
    /// </summary>
    public partial class UserControl1 : UserControl
    {

#if SILVERLIGHT
        public delegate void HoverEnterRoutedEventHandler(object sender, RoutedEventArgsEx e);
        public static readonly RoutedEventEx HoverEnterEvent = EventManagerEx.RegisterRoutedEvent("HoverEnter", RoutingStrategy.Bubble, typeof(HoverEnterRoutedEventHandler), typeof(UserControl1));
#else
        public delegate void HoverEnterRoutedEventHandler(object sender, RoutedEventArgsEx e);
        public static readonly RoutedEvent HoverEnterEvent = EventManager.RegisterRoutedEvent("HoverEnter", RoutingStrategy.Bubble, typeof(HoverEnterRoutedEventHandler), typeof(UserControl1));
#endif

        public static void AddHoverEnterHandler(DependencyObject o, HoverEnterRoutedEventHandler handler)
        {
            ((UIElement)o).AddHandlerEx(HoverEnterEvent, handler);
        }

        public static void RemoveHoverEnterHandler(DependencyObject o, HoverEnterRoutedEventHandler handler)
        {
            ((UIElement)o).RemoveHandlerEx(HoverEnterEvent, handler);
        }


        public UserControl1()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.RaiseEventEx(new RoutedEventArgsEx(HoverEnterEvent));
        }
    }
}
